ch=input()
s=input()
for i in range(len(s)-1,-1,-1):
    if s[i]==ch:
        print("index = %d"%i)
        exit()
print("Not Found")


